<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        .container {
            width: 400px;
            height: 400px;
            margin: 100px;
            padding: 100px;
            background-color: pink;
            border: 50px solid #ccc;
            /* 绝对定位不受父元素影响 */
            position: relative;
        }
        .box {
            width: 100px;
            height: 100px;
            background-color: green;
            position: fixed;
            left: 100px;
            top: 100px;
        }
        .box1 {
            /* width: 100px; */
            height: 100px;
            background-color: yellow;
            position: fixed;
            left: 10px;
            /* top: 0px; */
            right: 10px;
            bottom: 0px;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="box"></div>
    </div>
    <div class="box1"></div>
    <h1>hello</h1>
    <h1>hello</h1>
    <h1>hello</h1>
    <h1>hello</h1>
    <h1>hello</h1>
    <h1>hello</h1>
    <h1>hello</h1>
    <h1>hello</h1>
    <h1>hello</h1>
</body>
</html>